package com.rcp.manager;/* Restaurant Control Program >> Restaurant Manager */


import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.Set;


public class Schedule implements Serializable {

	private static final long serialVersionUID = 1L;
	private int EmployeeID;
	private String firstname;
	private String lastname;
	private LinkedHashMap< String, LinkedHashMap<String, String> >  days;
	
	Schedule(){
		super();
		
		this.days = new LinkedHashMap<String, LinkedHashMap<String, String> >();
		
	}
	
	Schedule(int id){
		this();
		this.EmployeeID = id;
	}
	
	Schedule(int id, String firstname, String lastname){
		this(id);
		this.firstname = firstname;
		this.lastname = lastname;
	}
	
	public void addDay(String day, String in, String out){
		if(days.containsKey(day)){
			LinkedHashMap<String, String> hours = days.get(day);
			hours.put(in, out);
			days.put(day, hours);
		}
		else{
			LinkedHashMap<String, String> hours = new LinkedHashMap<String, String>();
			hours.put(in, out);
			days.put(day, hours);
		}
	}
	
	public int getEmployeeID() {
		return EmployeeID;
	}

	public void setEmployeeID(int employeeID) {
		EmployeeID = employeeID;
	}

	public String getFirstname() {
		return firstname;
	}

	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}

	public String getLastname() {
		return lastname;
	}

	public void setLastname(String lastname) {
		this.lastname = lastname;
	}

	public LinkedHashMap<String, LinkedHashMap<String, String>> getDays() {
		return days;
	}

	public void setDays(LinkedHashMap<String, LinkedHashMap<String, String>> days) {
		this.days = days;
	}
	
	public LinkedHashMap<String, String> getTimes(String s){
		LinkedHashMap<String, String> times = new LinkedHashMap<String, String>();
		
		LinkedHashMap<String, String> today = days.get(s); 
		
		Set<String> keys= today.keySet();
		String[] in = (String[]) keys.toArray();
		
		for(int i = 0; i < today.size(); i++){
			
		}
		
		return times;
	}
	
	public String toString(){
		String s = "";
		
		s += "Schedule for: " + firstname + " " + lastname + " [" + EmployeeID + "] \n";
		s += "---------------------------------------------------------------\n";
		
		s += days.toString();
		
		s += "\n";
		
		return s;
	}

}
